<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Lordford extends CI_Model 
{

    function __construct()
    {
        parent::__construct();
    	$this->load->database();

	}
	
//################## commun function################################
	public function updatetemplate($tablename,$data,$where)
		{
				
			$str = $this->db->update_string($tablename, $data, $where);
			
			$query = $this->db->query($str);
			//print_r($query);
			
		}	
		
	public function insertetemplate($tablename,$data)
		{
				
			$str = $this->db->insert_string($tablename, $data);
			 
			$query = $this->db->query($str);
			$idinsert=$this->db->insert_id();
			return $idinsert;
			
		}	

		
		
//######################### end commun function###########################

public function getproductlist($rang)
	{
		$query=$this->db->query("SELECT * FROM rang$rang");
		return $query->result_array();
	}
	
}
